-
-
Notifications
You must be signed in to change notification settings - Fork 104
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/wasm remote 2 #1288
base: master
Are you sure you want to change the base?
Feature/wasm remote 2 #1288
Conversation
.gitmodules
Outdated
@@ -44,3 +44,6 @@ | |||
[submodule "3rdparty/hap"] | |||
path = 3rdparty/hap | |||
url = https://github.com/Vidvox/hap | |||
[submodule "3rdparty/qml-remote"] | |||
path = 3rdparty/qml-remote | |||
url = https://github.com/ossia/qml-remote.git |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's remove that part, we don't want this as a submodule
@@ -25,6 +25,7 @@ set(HDRS | |||
"RemoteControl/DocumentPlugin.hpp" | |||
"i-score-remote/RemoteApplication.hpp" | |||
"score_plugin_remotecontrol.hpp" | |||
"RemoteControl/Http_server.hpp" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you name that file HttpServer in line with the rest of score ?
"${CMAKE_CURRENT_SOURCE_DIR}/score_plugin_remotecontrol.cpp" | ||
) | ||
|
||
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/RemoteControl/build-wasm/ DESTINATION ${CMAKE_BINARY_DIR}/src/plugins/score-plugin-remotecontrol/CMakeFiles/score_plugin_remotecontrol.dir/RemoteControl/build-wasm/) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we won't need that: the remote's .wasm file is not supposed to be built as part of score but in a different repo which will be in the package manager
@@ -10,5 +11,6 @@ class ApplicationPlugin final : public score::GUIApplicationPlugin | |||
|
|||
protected: | |||
void on_createdDocument(score::Document& doc) override; | |||
Http_server m_server; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
HttpServer
{ | ||
auto const address2 = net::ip::make_address("0.0.0.0"); | ||
auto const port = static_cast<unsigned short>(std::atoi("8080")); | ||
auto const m_docRoot = std::make_shared<std::string>("./src/plugins/score-plugin-remotecontrol/CMakeFiles/score_plugin_remotecontrol.dir/RemoteControl/build-wasm/"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this line only works on the build computer.
instead we have to look for it in the user library which is where it will be installed on the user's computer:
#include <Library/LibrarySettings.hpp>
#include <score/application/ApplicationContext.hpp>
QString chemin_vers_dossier_packages = score::AppContext().settings<Library::Settings::Model>().getPackagesPath();
{ | ||
try | ||
{ | ||
auto const address2 = net::ip::make_address("0.0.0.0"); | ||
auto const port = static_cast<unsigned short>(std::atoi("8080")); | ||
auto const m_docRoot = std::make_shared<std::string>("./src/plugins/score-plugin-remotecontrol/CMakeFiles/score_plugin_remotecontrol.dir/RemoteControl/build-wasm/"); | ||
// auto const m_docRoot = std::make_shared<std::string>("./src/plugins/score-plugin-remotecontrol/CMakeFiles/score_plugin_remotecontrol.dir/RemoteControl/build-wasm/"); | ||
std::string packagesPath = score::AppContext().settings<Library::Settings::Model>().getPackagesPath().toUtf8().constData(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
getPackagesPath().toStdString() :-)
auto const m_docRoot = std::make_shared<std::string>("./src/plugins/score-plugin-remotecontrol/CMakeFiles/score_plugin_remotecontrol.dir/RemoteControl/build-wasm/"); | ||
// auto const m_docRoot = std::make_shared<std::string>("./src/plugins/score-plugin-remotecontrol/CMakeFiles/score_plugin_remotecontrol.dir/RemoteControl/build-wasm/"); | ||
std::string packagesPath = score::AppContext().settings<Library::Settings::Model>().getPackagesPath().toUtf8().constData(); | ||
QDebug << "packagesPath :" << packagesPath; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need for the QDebug anymore (.. does that compile ? it's supposed to be qDebug())
{ | ||
try | ||
{ | ||
auto const address2 = net::ip::make_address("0.0.0.0"); | ||
auto const port = static_cast<unsigned short>(std::atoi("8080")); | ||
auto const m_docRoot = std::make_shared<std::string>("./src/plugins/score-plugin-remotecontrol/CMakeFiles/score_plugin_remotecontrol.dir/RemoteControl/build-wasm/"); | ||
// auto const m_docRoot = std::make_shared<std::string>("./src/plugins/score-plugin-remotecontrol/CMakeFiles/score_plugin_remotecontrol.dir/RemoteControl/build-wasm/"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the comment can go
@@ -148,5 +150,6 @@ class Http_server | |||
|
|||
std::thread m_serverThread; | |||
int m_listenSocket{}; | |||
std::string buildWasmPath; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
m_ prefix for members
done @jcelerier |
ApplicationPlugin::~ApplicationPlugin() | ||
{ | ||
std::remove((m_server.m_buildWasmPath + "remote.html").c_str()); | ||
std::rename((m_server.m_buildWasmPath + "remote.html~").c_str(), (m_server.m_buildWasmPath + "remote.html").c_str()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
... what is happening here ?
1d961e8
to
919e08a
Compare
66a7ad0
to
5dc8d48
Compare
9a9b382
to
28c6d0a
Compare
ac5bf9a
to
fd8efed
Compare
No description provided.